| | |
| | | <result column="create_time" property="createTime"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO"> |
| | | <result column="total_count" property="totalCount"/> |
| | | <result column="my_count" property="myCount"/> |
| | | </resultMap> |
| | | |
| | | <sql id="gdClueEventDeptWhere"> |
| | | where ce.is_deleted = 0 |
| | | and ce.dispose_dept = #{deptId} |
| | | </sql> |
| | | |
| | | <resultMap id="gdClueEventExcelResultMap" type="org.sxkj.gd.workorder.excel.GdClueEventExcel"> |
| | | <result column="result_id" property="resultId"/> |
| | | <result column="work_order_id" property="workOrderId"/> |
| | |
| | | ce.create_time as create_time |
| | | from ja_gd_clue_event ce |
| | | left join ja_gd_task_result tr on tr.id = ce.result_id and tr.is_deleted = 0 |
| | | where ce.is_deleted = 0 |
| | | and ce.dispose_dept = #{deptId} |
| | | <include refid="gdClueEventDeptWhere"/> |
| | | <if test="onlyMine != null and onlyMine == 1"> |
| | | and ce.dispose_user = #{userId} |
| | | </if> |
| | |
| | | left join blade_user cu on cu.id = ce.create_user and cu.is_deleted = 0 |
| | | left join blade_dept cd on cd.id = ce.create_dept and cd.is_deleted = 0 |
| | | left join ja_gd_task_result tr on tr.id = ce.result_id and tr.is_deleted = 0 |
| | | where ce.is_deleted = 0 |
| | | and ce.dispose_dept = #{deptId} |
| | | <include refid="gdClueEventDeptWhere"/> |
| | | and ce.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectGdClueEventCount" resultMap="gdClueEventCountVoResultMap"> |
| | | select count(1) as total_count, |
| | | ifnull(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count |
| | | from ja_gd_clue_event ce |
| | | <include refid="gdClueEventDeptWhere"/> |
| | | </select> |
| | | |
| | | |
| | | <select id="exportGdClueEvent" resultMap="gdClueEventExcelResultMap"> |
| | | SELECT * FROM ja_gd_clue_event ${ew.customSqlSegment} |