123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.dayou.mapper.WorkTaskRecordMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.dayou.entity.WorkTaskRecord">
- <result column="id" property="id" />
- <result column="created" property="created" />
- <result column="modified" property="modified" />
- <result column="deleted" property="deleted" />
- <result column="instance_id" property="instanceId" />
- <result column="task_id" property="taskId" />
- <result column="handler_id" property="handlerId" />
- <result column="finished" property="finished" />
- <result column="finish_time" property="finishTime" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id,
- created,
- modified,
- deleted,
- instance_id, task_id, handler_id, finished, finish_time
- </sql>
- <update id="finishOpening">
- UPDATE work_task_record
- SET finished = 1,
- finish_time = now()
- WHERE
- instance_id = #{id}
- AND task_id = (
- SELECT
- wnt.id
- FROM
- `work_node_task` wnt
- LEFT JOIN work_node wn ON wn.id = wnt.node_id
- WHERE
- task_type = "OPENING"
- AND wnt.version = "LATEST"
- AND wn.flow_id = #{flowId}
- AND wnt.deleted = 0
- )
- AND deleted = 0
- </update>
- <select id="instanceNodeTasks" parameterType="java.lang.Long" resultType="com.dayou.dto.WorkNodeInstanceTaskDTO">
- SELECT
- wtr.id AS recordId,
- wtr.finished,
- wtr.handler_id,
- wnt.task_type,
- wnt.handler_permission,
- wnt.business_handle
- FROM
- work_task_record wtr
- LEFT JOIN work_node_task wnt ON wnt.id = wtr.task_id
- WHERE
- wtr.instance_id = #{instanceNodeId}
- AND wtr.deleted = 0
- </select>
- <select id="getNotBusinessHandleTaskId" parameterType="java.lang.Long" resultType="java.lang.Long">
- SELECT
- wtr.id
- FROM
- work_task_record wtr
- LEFT JOIN work_flow_node_instance wfni ON wtr.instance_id = wfni.id
- LEFT JOIN work_node_task wnt ON wtr.task_id = wnt.id
- WHERE
- wfni.id = #{instanceNodeId}
- AND wnt.deleted = 0
- AND wfni.deleted = 0
- AND wtr.deleted = 0
- AND wtr.finished = 0
- AND wnt.business_handle = 0
- </select>
- <select id="getInstanceTask" parameterType="java.lang.Long" resultType="com.dayou.vo.WorkTaskRecordVO">
- SELECT
- wtr.id,
- wfni.id AS instanceId,
- t.id AS taskId,
- u.name as handler,
- (case wtr.finished when 1 then '已完成' else '未完成' end) as finished,
- wtr.finish_time,
- t.description AS taskName,
- wfni.state AS nodeState
- FROM
- work_task_record wtr
- left join user u on u.id = wtr.handler_id
- LEFT JOIN work_node_task t ON t.id = wtr.task_id
- LEFT JOIN work_flow_node_instance wfni ON wfni.id = wtr.instance_id
- where wtr.instance_id = #{instanceId} and wtr.deleted = 0 and t.deleted = 0 and wfni.deleted = 0
- </select>
- <select id="taskTodoPage" parameterType="com.dayou.vo.TaskTodoVO" resultType="com.dayou.vo.TaskTodoVO">
- SELECT
- wfni.id,
- wtr.id as taskId,
- wfni.id AS currentNodeId,
- wfni.business_sub_id,
- wfni.business_sub_id as statementNo,
- wfni.business_min_id as reportNo,
- wfni.business_id,
- m.name as orderName,
- m.order_id,
- m.financial,
- m.allot_type,
- u1.name as clientManager,
- u2.name as principal,
- d.name as departmentName,
- m.business_object_type,
- wfni.name AS nodeName,
- wfni.code as nodeCode,
- u.name AS handler,
- wnt.description AS taskName,
- wtr.handler_id,
- wtr.finished as taskFinished,
- m.created,
- m.id as majorId,
- (select name from major_production where deleted = 0 and major_id = m.id and report_no= ifnull(wfni.business_min_id,wfni.business_sub_id)) as productionName,
- cc1.NAME AS cClienteleName,
- cc2.NAME AS cClienteleSubName,
- cl1.NAME AS cClienteleContactName,
- cl1.mobile AS cMobile,
- wtr.created as taskCreated
- FROM
- work_task_record wtr
- LEFT JOIN work_node_task wnt ON wnt.id = wtr.task_id
- inner JOIN (
- SELECT
- wn.NAME,
- wn.CODE,
- wfni.id,
- wfni.business_id ,
- wfni.business_sub_id,
- wfni.business_min_id,
- wfni.state
- FROM
- work_flow_node_instance wfni
- LEFT JOIN work_node wn ON wn.id = wfni.node_id
- WHERE
- wfni.business_type = 'MAJOR_BUSINESS'
- AND wfni.state = 'PENDING'
- AND wfni.deleted = 0
- AND wn.deleted = 0
- ) wfni ON wtr.instance_id = wfni.id
- LEFT JOIN major m ON m.id = wfni.business_id
- LEFT JOIN user u ON u.id = wtr.handler_id
- left join user u1 on u1.id = m.client_manager_id
- left join user u2 on u2.id = m.principal_id
- left join department d on d.id = m.department_id
- LEFT JOIN customer_company cc1 ON cc1.id = m.clientele_id
- LEFT JOIN customer_company cc2 ON cc2.id = m.clientele_sub_id
- LEFT JOIN customer_linkman cl1 ON cl1.id = m.clientele_contact_id
- WHERE
- wtr.handler_id =#{todoVO.handlerId}
- AND u.deleted = 0
- AND wnt.deleted = 0
- AND wtr.deleted = 0
- <if test="keyword!=null and keyword!='' ">
- and(
- m.name like concat ('%',#{keyword},'%')
- or m.order_id like concat('%',#{keyword},'%')
- or wfni.business_sub_id like concat('%',#{keyword},'%')
- or u1.name like concat ('%',#{keyword},'%')
- or u2.name like concat ('%',#{keyword},'%')
- or m.business_object_type like concat ('%',#{keyword},'%')
- or u.name like concat ('%',#{keyword},'%')
- or wfni.name like concat('%',#{keyword},'%')
- )
- </if>
- <if test="todoVO!=null and todoVO.nodeName!=null and todoVO.nodeName!='' ">
- and wfni.name = #{todoVO.nodeName}
- </if>
- <if test="todoVO!=null and todoVO.startDate!=null and todoVO.startDate!=''">
- and m.created >= #{todoVO.startDate}
- </if>
- <if test="todoVO!=null and todoVO.endDate!=null and todoVO.endDate!=''">
- and m.created <= #{todoVO.endDate}
- </if>
- ORDER BY wtr.created DESC
- </select>
- <select id="majorTaskDonePage" parameterType="com.dayou.vo.MajorTaskDoneVO" resultType="com.dayou.vo.MajorTaskDoneVO">
- SELECT
- wf.id,
- u.name AS handler,
- wf.handler_id,
- (case wf.state when 'PASS' then '提交' when 'REVERSE' then '退回' when 'TERMINATE' then '终止' else '-' end) as state,
- wf.handing_time as handingTimeLong,
- wf.comments,
- wf.business_type,
- m.id AS majorId,
- m.order_id,
- m.name AS majorName,
- wn.name AS nodeName,
- wf.created as finishTime,
- ifnull(wf.business_min_id,wf.business_sub_id) as reportNo,
- wfni.state as instanceState,
- wfni.id as instanceId,
- (select name from major_production where deleted = 0 and report_no= (ifnull(wf.business_min_id,wf.business_sub_id))) as productionName
- FROM
- (
- ( SELECT * FROM work_flow_log WHERE handler_id = #{todoVO.handlerId} and business_type='MAJOR_BUSINESS' ) wf
- LEFT JOIN ( SELECT id, node_id, business_id ,state FROM work_flow_node_instance ) wfni ON wf.instance_id = wfni.id
- LEFT JOIN ( SELECT id, NAME FROM work_node WHERE deleted = 0 ) wn ON wn.id = wfni.node_id
- LEFT JOIN ( SELECT id, order_id, NAME FROM major WHERE deleted = 0 ) m ON m.id = wf.business_id
- LEFT JOIN user u ON u.id = wf.handler_id
- )
- <where>
- <if test="keyword!=null and keyword!='' ">
- and (
- m.name like concat ('%',#{keyword},'%')
- or m.order_id like concat('%',#{keyword},'%')
- or wf.business_sub_id like concat('%',#{keyword},'%')
- )
- </if>
- <if test="todoVO!=null and todoVO.nodeName!=null and todoVO.nodeName!='' ">
- and wn.name = #{todoVO.nodeName}
- </if>
- <if test="todoVO!=null and todoVO.state!=null and todoVO.state!='' ">
- and wf.state = #{todoVO.state}
- </if>
- <if test="todoVO!=null and todoVO.startDate!=null and todoVO.startDate!=''">
- and wf.created >= #{todoVO.startDate}
- </if>
- <if test="todoVO!=null and todoVO.endDate!=null and todoVO.endDate!=''">
- and wf.created <= #{todoVO.endDate}
- </if>
- </where>
- ORDER BY
- wf.created DESC
- </select>
- <update id="batchFinishTask" parameterType="java.util.List">
- update work_task_record set finished = 1 ,finish_time = now() where id in (
- <foreach collection="ids" index="index" separator="," item="item">
- #{item}
- </foreach>
- )
- </update>
- <select id="personalTodoPage" parameterType="com.dayou.vo.TaskTodoVO" resultType="com.dayou.vo.PersonalTodoVO">
- SELECT
- wfni.id,
- wtr.id AS taskId,
- wfni.id AS currentNodeId,
- wfni.business_id,
- p.location,
- p.order_id,
- u1.name AS clientManager,
- wfni.name AS nodeName,
- wfni.code AS nodeCode,
- u.name AS handlerName,
- wtr.handler_id,
- wtr.finished AS taskFinished,
- p.created,
- cc.name AS clientName,
- cc1.name AS clientSubName,
- p.agent,
- cl.name AS contactName,
- cl.mobile AS contactTel,
- p.bailorA,
- p.bailorB,
- p.bailorA_tel,
- p.bailorB_tel,
- u2.name AS outwardStaffName,
- u3.name AS inwardStaffName,
- u4.name AS pricingStaffName,
- wfni.created AS nodeCreated,
- pt.acreage,
- pt.amount,
- pt.price
- FROM
- work_task_record wtr
- LEFT JOIN work_node_task wnt ON wnt.id = wtr.task_id
- INNER JOIN (
- SELECT
- wn.NAME,
- wn.CODE,
- wfni.id,
- wfni.business_id,
- wfni.state,
- wfni.created
- FROM
- work_flow_node_instance wfni
- LEFT JOIN work_node wn ON wn.id = wfni.node_id
- WHERE
- wfni.business_type = 'PERSONAL_BUSINESS'
- AND wfni.state = 'PENDING'
- AND wfni.deleted = 0
- AND wn.deleted = 0
- ) wfni ON wtr.instance_id = wfni.id
- LEFT JOIN personal p ON p.id = wfni.business_id
- LEFT JOIN customer_company cc ON cc.id = p.clientele_id
- LEFT JOIN customer_company cc1 ON cc1.id = p.clientele_sub_id
- LEFT JOIN customer_linkman cl ON cl.id = p.clientele_contact_id
- LEFT JOIN user u ON u.id = wtr.handler_id
- LEFT JOIN user u1 ON u1.id = p.client_manager_id
- LEFT JOIN user u2 ON u2.id = p.outward_staff
- LEFT JOIN user u3 ON u3.id = p.inward_staff
- LEFT JOIN user u4 ON u4.id = p.pricing_staff
- LEFT JOIN personal_target pt ON pt.personal_id = p.id
- WHERE
- wtr.handler_id = #{personal.handlerId}
- AND u.deleted = 0
- AND wnt.deleted = 0
- AND wtr.deleted = 0
- <if test="keyword!=null and keyword!='' ">
- and (
- p.location like concat ('%',#{keyword},'%')
- or p.order_id like concat('%',#{keyword},'%')
- or p.agent like concat('%',#{keyword},'%')
- or p.bailorA like concat('%',#{keyword},'%')
- or p.bailorB like concat('%',#{keyword},'%')
- or cc.name like concat('%',#{keyword},'%')
- or cc1.name like concat('%',#{keyword},'%')
- or cl.name like concat('%',#{keyword},'%')
- )
- </if>
- <if test="personal!=null and personal.startDate!=null and personal.startDate!=''">
- and p.created >= #{personal.startDate}
- </if>
- <if test="personal!=null and personal.endDate!=null and personal.endDate!=''">
- and p.created <= #{personal.endDate}
- </if>
- <if test="personal!=null and personal.nodeCode!=null and personal.nodeCode!=''">
- and wn.code = #{personal.nodeCode}
- </if>
- <if test="personal!=null and personal.clientName!=null and personal.clientName!=''">
- and cc.NAME like concat('%',#{personal.clientName},'%')
- </if>
- <if test="personal!=null and personal.clientSubName!=null and personal.clientSubName!=''">
- and cc1.NAME like concat('%',#{personal.clientSubName},'%')
- </if>
- <if test="personal!=null and personal.clientManager!=null and personal.clientManager!='' ">
- and u.name like concat('%',#{personal.clientManager},'%')
- </if>
- <if test="personal!=null and personal.outwardStaffName!=null and personal.outwardStaffName!='' ">
- and u1.name like concat('%',#{personal.outwardStaffName},'%')
- </if>
- <if test="personal!=null and personal.inwardStaffName!=null and personal.inwardStaffName!='' ">
- and u2.name like concat('%',#{personal.inwardStaffName},'%')
- </if>
- <if test="personal!=null and personal.pricingStaffName!=null and personal.pricingStaffName!='' ">
- and u3.name like concat('%',#{personal.pricingStaffName},'%')
- </if>
- <if test="personal!=null and personal.handlerName!=null and personal.handlerName!='' ">
- and u4.name like concat('%',#{personal.handlerName},'%')
- </if>
- </select>
- <select id="personalTaskDonePage" parameterType="com.dayou.vo.PersonalTaskDoneVO" resultType="com.dayou.vo.PersonalTaskDoneVO">
- SELECT
- wf.id,
- u.name AS handler,
- wf.handler_id,
- (case wf.state when 'PASS' then '提交' when 'REVERSE' then '退回' when 'TERMINATE' then '终止' else '-' end) as state,
- wf.handing_time as handingTimeLong,
- wf.comments,
- wf.business_type,
- p.id AS personalId,
- p.order_id,
- p.location,
- p.clientName,
- p.clientSubName,
- p.bailorA,
- p.bailorB,
- wn.name AS nodeName,
- wf.created as finishTime,
- ifnull(wf.business_min_id,wf.business_sub_id) as reportNo,
- wfni.state as instanceState,
- wfni.id as instanceId
- FROM
- (
- ( SELECT * FROM work_flow_log WHERE handler_id = #{todoVO.handlerId} and business_type='PERSONAL_BUSINESS' ) wf
- LEFT JOIN ( SELECT id, node_id, business_id ,state FROM work_flow_node_instance ) wfni ON wf.instance_id = wfni.id
- LEFT JOIN ( SELECT id, name FROM work_node WHERE deleted = 0 ) wn ON wn.id = wfni.node_id
- LEFT JOIN ( SELECT p.id, p.order_id, p.location,cc.name as clientName,cc1.name as clientSubName,p.bailorA,p.bailorB FROM personal p left join customer_company cc on cc.id =
- p.clientele_id left join customer_company cc1 on cc1.id = p.clientele_sub_id
- WHERE p.deleted = 0) p ON p.id = wf.business_id
- LEFT JOIN user u ON u.id = wf.handler_id
- )
- <where>
- <if test="keyword!=null and keyword!='' ">
- and (
- p.location like concat ('%',#{keyword},'%')
- or p.order_id like concat('%',#{keyword},'%')
- or p.clientName like concat('%',#{keyword},'%')
- or p.clientSubName like concat('%',#{keyword},'%')
- )
- </if>
- <if test="todoVO!=null and todoVO.nodeName!=null and todoVO.nodeName!='' ">
- and wn.name = #{todoVO.nodeName}
- </if>
- <if test="todoVO!=null and todoVO.state!=null and todoVO.state!='' ">
- and wf.state = #{todoVO.state}
- </if>
- <if test="todoVO!=null and todoVO.startDate!=null and todoVO.startDate!=''">
- and wf.created >= #{todoVO.startDate}
- </if>
- <if test="todoVO!=null and todoVO.endDate!=null and todoVO.endDate!=''">
- and wf.created <= #{todoVO.endDate}
- </if>
- </where>
- ORDER BY
- wf.created DESC
- </select>
- <select id="majorTodoSimpleList" parameterType="java.lang.Long" resultType="com.dayou.vo.TaskTodoVO">
- SELECT
- wfni.id,
- wtr.id as taskId,
- wfni.id AS currentNodeId,
- wfni.business_sub_id as statementNo,
- wfni.business_min_id as reportNo,
- wfni.business_id,
- m.name as orderName,
- m.order_id,
- wfni.name AS nodeName,
- wfni.code as nodeCode,
- wfni.created as instanceCreated
- FROM
- work_task_record wtr
- inner JOIN (
- SELECT
- wn.NAME,
- wn.CODE,
- wfni.id,
- wfni.business_id ,
- wfni.business_sub_id,
- wfni.business_min_id,
- wfni.state,
- wfni.created
- FROM
- work_flow_node_instance wfni
- LEFT JOIN work_node wn ON wn.id = wfni.node_id
- WHERE
- wfni.business_type = 'MAJOR_BUSINESS'
- AND wfni.state = 'PENDING'
- AND wfni.deleted = 0
- AND wn.deleted = 0
- ) wfni ON wtr.instance_id = wfni.id
- LEFT JOIN major m ON m.id = wfni.business_id
- WHERE
- wtr.handler_id = #{handlerId}
- AND wtr.deleted = 0
- order by wfni.created limit 8
- </select>
- <select id="personalTodoSimpleList" parameterType="java.lang.Long" resultType="com.dayou.vo.PersonalTodoVO">
- SELECT
- wfni.id,
- wtr.id AS taskId,
- wfni.id AS currentNodeId,
- wfni.business_id,
- p.location,
- p.order_id,
- wfni.name AS nodeName,
- wfni.code AS nodeCode,
- wfni.created as instanceCreated
- FROM
- work_task_record wtr
- LEFT JOIN work_node_task wnt ON wnt.id = wtr.task_id
- INNER JOIN (
- SELECT
- wn.NAME,
- wn.CODE,
- wfni.id,
- wfni.business_id,
- wfni.state,
- wfni.created
- FROM
- work_flow_node_instance wfni
- LEFT JOIN work_node wn ON wn.id = wfni.node_id
- WHERE
- wfni.business_type = 'PERSONAL_BUSINESS'
- AND wfni.state = 'PENDING'
- AND wfni.deleted = 0
- AND wn.deleted = 0
- ) wfni ON wtr.instance_id = wfni.id
- LEFT JOIN personal p ON p.id = wfni.business_id
- WHERE
- wtr.handler_id = #{handlerId}
- AND wnt.deleted = 0
- AND wtr.deleted = 0
- order by wfni.created desc limit 8
- </select>
- <select id="getTodoTotalNum" parameterType="java.lang.Long" resultType="com.dayou.vo.BusinessTodoNum">
- SELECT
- wfni.business_type,
- count( wfni.id ) AS totalNum
- FROM
- work_task_record wtr
- INNER JOIN ( SELECT wfni.business_type, wfni.id FROM work_flow_node_instance wfni WHERE wfni.state = 'PENDING' AND wfni.deleted = 0 ) wfni ON wtr.instance_id = wfni.id
- WHERE
- wtr.handler_id = #{handlerId}
- AND wtr.deleted = 0
- GROUP BY
- wfni.business_type
- </select>
- <!--获取资产业务已办列表-->
- <select id="getAssetsTaskDoneList" resultType="com.dayou.vo.AssetsTaskDoneVO">
- SELECT DISTINCT
- (@i := @i + 1) AS id,
- instance.recordId,
- log.id AS logId,
- user.name AS handlerName,
- log.handler_id,
- (case log.state
- when 'PASS' then '提交'
- when 'REVERSE' then '退回'
- when 'TERMINATE' then '终止'
- else '-' end) AS state,
- log.handing_time AS handingTimeLong,
- log.comments,
- log.business_type,
- assets.id AS assetsId,
- assets.order_id AS orderId,
- assets.name AS assetsName,
- node.name AS nodeName,
- node.code AS nodeCode,
- log.created AS finishTime,
- instance.business_sub_id AS statementNo,
- (SELECT assets_name FROM assets_production WHERE assets_production.production_no = instance.business_sub_id) AS
- statementName,
- (SELECT assets_name FROM assets_production WHERE assets_production.production_no = instance.business_min_id) AS
- reportName,
- instance.business_min_id AS reportNo,
- instance.state AS instanceState,
- instance.id AS instanceId,
- instance.created AS startDate
- FROM
- (SELECT @i := 0) AS sort,
- work_flow_log AS log
- LEFT JOIN (SELECT work_flow_node_instance.id, node_id, business_id, state, business_sub_id,
- business_min_id,work_task_record.created,work_task_record.id AS recordId
- FROM work_flow_node_instance,work_task_record
- WHERE state = 'FINISHED'
- AND work_flow_node_instance.id = work_task_record.instance_id
- AND work_flow_node_instance.deleted = 0) AS instance ON log.instance_id = instance.id
- LEFT JOIN (SELECT id, name, code FROM work_node WHERE deleted = 0) AS node ON node.id = instance.node_id
- LEFT JOIN (SELECT id, order_id, name, department_id FROM assets WHERE deleted = 0) AS assets ON assets.id = log.business_id
- LEFT JOIN user ON user.id = log.handler_id
- <if test="assetsSelectDTO != null and assetsSelectDTO.selectByDepartment">
- INNER JOIN (
- SELECT DISTINCT
- department.id,
- department.parent_id,
- user.id AS userId
- FROM
- user,
- post,
- department,
- user_post ,
- work_task_record AS record
- WHERE
- user.id = user_post.user_id
- AND user_post.post_id = post.id
- AND post.department_id = department.id
- AND user_post.deleted = 0
- ) AS department ON (department.id IN
- <foreach collection="assetsSelectDTO.departmentIdList" index="index" item="item" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- OR department.parent_id IN
- <foreach collection="assetsSelectDTO.departmentIdList" index="index" item="item" open="(" separator=","
- close=")">
- #{item}
- </foreach>
- )
- AND department.userId = log.handler_id
- </if>
- WHERE instance.id IS NOT NULL
- AND log.business_type = 'ASSET_BUSINESS'
- <if test="assetsSelectDTO != null and assetsSelectDTO.handlerId != null">
- AND handler_id = #{assetsSelectDTO.handlerId}
- </if>
- <if test="assetsSelectDTO != null and assetsSelectDTO.keyWord != null and assetsSelectDTO.keyWord != '' ">
- AND (
- assets.order_id LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
- assets.name LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
- instance.business_sub_id LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
- instance.business_min_id LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%')
- )
- </if>
- <if test="assetsSelectDTO != null and assetsSelectDTO.nodeCode != null">
- AND node.code = #{assetsSelectDTO.nodeCode}
- </if>
- <if test="assetsSelectDTO != null and assetsSelectDTO.departmentId">
- AND assets.department_id = #{assetsSelectDTO.departmentId}
- </if>
- ORDER BY log.created DESC
- </select>
- </mapper>
|