‘liusuyi’
2023-08-01 d828d6f8f842a3122070f2b0602fec9b38b14791
ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml
@@ -27,7 +27,12 @@
        <!--        <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"-->
        <!--                    resultMap="ArdAppTaskDetailResult"/>-->
    </resultMap>
    <resultMap id="ArdAppTaskSub1Result" type="ArdAppTask" extends="ArdAppTaskResult">
                <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List"
                            resultMap="ArdAppTaskPicResult"/>
                <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"
                            resultMap="ArdAppTaskDetailResult"/>
    </resultMap>
    <resultMap type="ArdAppTaskDetail" id="ArdAppTaskDetailResult">
        <result property="id" column="sub1_id"/>
        <result property="name" column="sub1_name"/>
@@ -61,9 +66,7 @@
               c.create_by,
               c.create_time,
               c.update_by,
               c.update_time,
               c.view_time,
               c.view_position
               c.update_time
        from ard_app_task c
                 left join sys_dept d on d.dept_id = c.dept_id
                 left join sys_user u on u.user_id = c.user_id
@@ -95,7 +98,8 @@
               c.view_time        as sub1_view_time,
               c.view_position    as sub1_view_position,
               c.clock_in_time    as sub1_clock_in_time,
               c.view_flag        as sub1_view_flag
               c.view_flag        as sub1_view_flag,
               c.task_id          as sub1_task_id
        from ard_app_task a
                 left join ard_app_task_pic b on b.task_id = a.id
                 left join ard_app_task_detail c on c.task_id = a.id
@@ -104,18 +108,16 @@
    <select id="selectArdAppTaskList" parameterType="ArdAppTask" resultMap="ArdAppTaskResult">
        <include refid="selectArdAppTaskVo"/>
        <where>
            <if test="name != null  and name != ''">and name like '%'||#{name}||'%'</if>
            <if test="text != null  and text != ''">and text = #{text}</if>
            <if test="voice != null  and voice != ''">and voice = #{voice}</if>
            <if test="name != null  and name != ''">and c.name like '%'||#{name}||'%'</if>
            <if test="text != null  and text != ''">and c.text = #{text}</if>
            <if test="voice != null  and voice != ''">and c.voice = #{voice}</if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                and create_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
                and c.create_time &gt;= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
                and create_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
                and c.create_time &lt;= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
            </if>
            <if test="userId != null  and userId != ''">and user_id = #{userId}</if>
            <!-- 数据范围过滤 -->
            ${params.dataScope}
            <if test="userId != null  and userId != ''">and c.user_id = #{userId}</if>
        </where>
    </select>
@@ -157,7 +159,7 @@
        </where>
    </select>
    <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSubResult">
    <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSub1Result">
        <include refid="selectArdAppTaskDto"/>
        where a.id = #{id}
    </select>
@@ -169,6 +171,10 @@
    <select id="selectArdAppTaskPicListById" resultType="ArdAppTaskPic">
        select * from ard_app_task_pic d where d.task_id = #{id}
    </select>
    <select id="selectArdAppTaskDetailUserIdsByTaskId" parameterType="String" resultType="java.lang.String">
        select DISTINCT(user_id) from ard_app_task_detail where task_id=#{taskId}
    </select>
    <insert id="insertArdAppTask" parameterType="ArdAppTask">
        insert into ard_app_task