- select oh.*,s.StatusName,st.Status,ps.StatusName AS PayStatusName from orderheader oh
- LEFT JOIN orderdetail od on od.OrderID=oh.OrderID
- LEFT JOIN customer c on oh.CustomerID = c.CustomerID
- LEFT JOIN (SELECT StatusName,StatusCode from `status` where StatusType='OrderStatus') as s on s.StatusCode=oh.OrderStatus
- LEFT JOIN (SELECT StatusName,StatusCode from `status` where StatusType='PayStatus') as ps on ps.StatusCode=oh.PayStatus
- lEFT JOIN(select Status,OrderID from troublecase) as st on st.OrderID=oh.OrderID
- where 1=1
- <if test="pd.StartDate!=null and pd.StartDate!=''" >
- and DATE_FORMAT(OrderDate,'%Y-%m-%d')>=DATE_FORMAT(#{pd.StartDate},'%Y-%m-%d')
- </if>
- <if test="pd.EndDate!=null and pd.EndDate!=''">
- and DATE_FOR
sql语句实现一个输入框下多条件查询
最新推荐文章于 2022-09-16 06:43:16 发布