| | |
| | | `workPlans`.`IMPORT_ID`, |
| | | `workPlans`.`PAUSED`, |
| | | `workPlans`.`USER_ID`, |
| | | `workPlans`.`SALESORDER`, |
| | | `workPlans`.`PUBLISH_DATE` |
| | | FROM `work_plans` `workPlans` |
| | | <where> |
| | |
| | | <if test="publishDate != null"> |
| | | AND `workPlans`.`PUBLISH_DATE` = #{publishDate} |
| | | </if> |
| | | <if test="salesorder != null"> |
| | | AND `workPlans`.`SALESORDER` = #{salesorder} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | FROM `work_plans` `a` |
| | | LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID |
| | | LEFT JOIN `material_distribute` `mdmodel` ON a.MATERIAL_ID=mdmodel.ID |
| | | LEFT JOIN `material` `mmodel` ON mdmodel.MATERIAL_ID=mmodel.ID |
| | | LEFT JOIN `material` `mmodel` ON mdmodel.MATERIAL_ID=mmodel.ID |
| | | LEFT JOIN `department` `fmodel` ON a.FACTORY_ID=fmodel.ID |
| | | LEFT JOIN `unit` `umodel` ON a.UNIT_ID=umodel.ID |
| | | LEFT JOIN `system_user` `usermodel` ON a.USER_ID=usermodel.ID |
| | |
| | | <if test="batch != null and batch != ''"> |
| | | AND `a`.`batch` like concat('%',#{batch},'%') |
| | | </if> |
| | | <if test="salesorder != null and salesorder != ''"> |
| | | AND `a`.`SALESORDER` like concat('%',#{salesorder},'%') |
| | | </if> |
| | | <if test="startDateStart != null and startDateStart != ''"> |
| | | AND `a`.`START_DATE` >= concat(#{planDateStart},' 00:00:00') |
| | | </if> |
| | | <if test="startDateEnd != null and startDateEnd != ''"> |
| | | AND concat(#{planDateEnd},' 23:59:59') >= `a`.`START_DATE` |
| | | </if> |
| | | <if test="planDateStart != null and planDateStart != ''"> |
| | | AND `a`.`PLAN_DATE` >= concat(#{planDateStart},' 00:00:00') |
| | | </if> |
| | |
| | | AND concat(#{planDateEnd},' 23:59:59') >= `a`.`PLAN_DATE` |
| | | </if> |
| | | </where> |
| | | order by a.START_DATE desc, a.CREATE_TIME desc |
| | | order by a.PLAN_DATE desc, a.CREATE_TIME desc |
| | | </select> |
| | | |
| | | |