1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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,
- 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_sb_info sb on application.sb_id = sb.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="zbh != null and zbh != ''">
- and sb.zbh = #{zbh}
- </if>
- <if test="no != null and no != ''">
- and application.no = #{no}
- </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}
- </if>
- </if>
- <if test="checkUserId != null and checkUserId != ''">
- and application.check_user_id = #{checkUserId}
- </if>
- <if test="searchStartTime != null">
- and checkjob.start_time <![CDATA[ >= ]]> #{searchStartTime}
- </if>
- <if test="searchEndTime != null">
- and checkjob.start_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_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>
|