| | |
| | | <mapper namespace="com.jilongda.manage.mapper.TFrameGoodsMapper"> |
| | | |
| | | |
| | | <select id="lensReceiptList" resultType="com.jilongda.manage.vo.TFrameGoodsVO"> |
| | | select t1.*,t2.name as model,t5.name as supplier,t3.name as material,t4.name as store, |
| | | t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold |
| | | from |
| | | t_frame_goods t1 |
| | | left join t_model t2 on t1.modelId=t2.id |
| | | left join t_material t3 on t2.materialId = t3.id |
| | | left join t_store t4 on t1.storeId = t4.id |
| | | left join t_supplier t5 on t2.supplierId = t5.id |
| | | left join t_brand t6 on t2.brandId=t6.id |
| | | left join sec_setting t7 on 1=1 |
| | | where 1=1 |
| | | <if test="query.brandId != null "> |
| | | and t2.brandId = #{query.brandId} |
| | | </if> |
| | | <if test="query.supplierId != null "> |
| | | and t2.supplierId = #{query.supplierId} |
| | | </if> |
| | | <if test="query.color != null and query.color != ''"> |
| | | and t1.color = #{query.color} |
| | | </if> |
| | | <if test="query.storeId != null "> |
| | | and t1.storeId = #{query.storeId} |
| | | </if> |
| | | <if test="query.model != null and query.model != ''"> |
| | | and t2.name = #{query.model} |
| | | </if> |
| | | <if test="query.materialId != null "> |
| | | and t2.materialId = #{query.materialId} |
| | | </if> |
| | | <if test="query.status != null "> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.isWarning != null and query.isWarning = 1"> |
| | | and t1.total < t7.frameThreshold |
| | | </if> |
| | | <if test="query.isWarning != null and query.isWarning = 2"> |
| | | and t1.total >= t7.frameThreshold |
| | | </if> |
| | | <if test="query.startCount != null and query.endCount != null"> |
| | | and t1.total between #{query.startCount} and #{query.endCount} |
| | | </if> |
| | | order by t1.id |
| | | </select> |
| | | </mapper> |