| | |
| | | <select id="selectByModel" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO"> |
| | | SELECT |
| | | `a`.* |
| | | ,ifnull(( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status not in (7,8) ),0) AS workorderDistributNum |
| | | ,ifnull(( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status = 4 ),0) AS workorderDistributNum |
| | | from plans a |
| | | <where> |
| | | <if test="id != null"> |
| | |
| | | <!-- AND #{endDate} >= `a`.`PLAN_DATE`--> |
| | | <!-- </if>--> |
| | | <if test="mixParam != null and mixParam!=''"> |
| | | AND (mmodel.name like concat('%',#{mixParam},'%') or mmodel.code like concat('%',#{mixParam},'%') or pmodel.name like concat('%',#{mixParam},'%')) |
| | | AND (mmodel.name like concat('%',#{mixParam},'%') or mmodel.code like concat('%',#{mixParam},'%') or pmodel.name like concat('%',#{mixParam},'%') or a.BATCH like concat('%',#{mixParam},'%') or w.SALESORDER like concat('%',#{mixParam},'%') ) |
| | | </if> |
| | | <if test="usermodelInvalidTime != null"> |
| | | AND `usermodel`.`INVALID_TIME` = #{usermodelInvalidTime} |