123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?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.platform.dao.mapper.repair.RepairApplicationFormMapper">
- <sql id="Base_Column_List">
- application.*,
- user.real_name as userName,
- user2.real_name as repairUserName,
- user3.real_name as checkUserName,
- user4.real_name as repairUser,
- sb.name as sbName,part.name as partName,
- sb.no as sbNo, sb.cph as sbCph, sb.model_id as modelId,
- error.name as repairErrorTypeName
- </sql>
- <select id="selectPageList" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
- resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
- select
- <include refid="Base_Column_List"/>
- from t_repair_application_form application
- left join t_sys_user user on application.user_id = user.user_id
- left join t_sys_user user2 on application.repair_user_id = user2.user_id
- left join t_sys_user user3 on application.check_user_id = user3.user_id
- left join t_sb_info sb on application.sb_id = sb.id
- left join t_sys_user user4 on sb.repair_user = user4.user_id
- left join t_error_type error on application.repair_error_type_id = error.id
- left join t_part_info part on application.part_id = part.id
- <where>
- <if test="keyword != null and keyword != ''">
- and ( sb.name like concat('%',#{keyword},'%') or
- sb.no like concat('%',#{keyword},'%') or
- application.content like concat('%',#{keyword},'%') )
- </if>
- <if test="content != null and content != ''">
- and application.content like concat('%',#{content},'%')
- </if>
- <if test="sbId != null and sbId != ''">
- and application.sb_id = #{sbId}
- </if>
- <if test="category != null and category != ''">
- and application.category = #{category}
- </if>
- <if test="categoryList != null and categoryList.size > 0">
- AND application.category in
- <foreach item="item" index="index" collection="categoryList" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="zbh != null and zbh != ''">
- and sb.zbh = #{zbh}
- </if>
- <if test="no != null and no != ''">
- and application.no = #{no}
- </if>
- <if test="planFlag != null and planFlag != ''">
- and application.plan_flag = #{planFlag}
- </if>
- <if test="status != null and status != ''">
- and application.status = #{status}
- </if>
- <if test="actualUser != null and actualUser != ''">
- and application.actual_user = #{actualUser}
- </if>
- <if test="mainRepairId != null and mainRepairId != ''">
- and application.main_repair_id = #{mainRepairId}
- </if>
- <if test="outType != null and outType != ''">
- and application.out_type = #{outType}
- </if>
- <if test="type != null and type != ''">
- and application.type = #{type}
- </if>
- <if test="status != null and status != ''">
- and application.status = #{status}
- </if>
- <if test="userId != null and userId != ''">
- and application.user_id = #{userId}
- </if>
- <if test="repairUserId != null and repairUserId != ''">
- <if test="repairUserIdOrNoAssignFlag != null and repairUserIdOrNoAssignFlag == true">
- and (application.repair_user_id = #{repairUserId} or application.repair_user_id is null)
- </if>
- <if test="repairUserIdOrNoAssignFlag == null || repairUserIdOrNoAssignFlag == false">
- and (application.repair_user_id = #{repairUserId} or sb.repair_user_second = #{repairUserId} )
- </if>
- </if>
- <if test="checkUserId != null and checkUserId != ''">
- and application.check_user_id = #{checkUserId}
- </if>
- <if test="repairUserName != null and repairUserName != ''">
- and user2.real_name like concat('%',#{repairUserName},'%')
- </if>
- <if test="searchStartTime != null">
- and application.apply_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and application.apply_time <![CDATA[ <= ]]> #{searchEndTime}
- </if>
- </where>
- </select>
- <select id="selectById" parameterType="java.lang.Object"
- resultType="com.platform.dao.entity.repair.RepairApplicationForm">
- select
- <include refid="Base_Column_List"/>
- from t_repair_application_form application
- left join t_sys_user user on application.user_id = user.user_id
- left join t_sys_user user2 on application.repair_user_id = user2.user_id
- left join t_sys_user user3 on application.check_user_id = user3.user_id
- left join t_sb_info sb on application.sb_id = sb.id
- left join t_part_info part on application.part_id = part.id
- left join t_error_type error on application.repair_error_type_id = error.id
- where application.id = #{id,jdbcType=VARCHAR}
- </select>
- <select id="selectNoById" parameterType="java.lang.Object" resultType="java.lang.String">
- select no
- from t_repair_application_form
- where id = #{id,jdbcType=VARCHAR}
- </select>
- </mapper>
|