123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?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.check.CheckStandardMapper">
- <sql id="Base_Column_List">
- checkstandard.id,
- checkstandard.sb_id,
- checkstandard.standard_hours,
- checkstandard.real_hours,
- checkstandard.check_user_id,
- checkstandard.name,
- checkstandard.level,
- checkstandard.no,
- checkstandard.type,
- checkstandard.period,
- checkstandard.period_type,
- checkstandard.action_type,
- checkstandard.check_user_type,
- checkstandard.enable,
- checkstandard.part,
- checkstandard.sort,
- checkstandard.requirement,
- checkstandard.remark,
- checkstandard.created_user_id,
- checkstandard.update_user_id,
- checkstandard.created_user_name,
- checkstandard.update_user_name,
- checkstandard.last_date,
- checkstandard.next_date,
- checkstandard.created_time,
- checkstandard.update_time
- </sql>
- <sql id="Ref_Column_List">
- checkstandard.sb_id,
- checkstandard.standard_hours,
- checkstandard.real_hours,
- checkstandard.check_user_id,
- checkstandard.name,checkstandard.level,
- checkstandard.sort,
- checkstandard.no,
- checkstandard.last_date,
- checkstandard.next_date,
- checkstandard.type,
- checkstandard.period,
- checkstandard.part,
- checkstandard.period_type,
- checkstandard.action_type,
- checkstandard.check_user_type,
- checkstandard.enable,
- checkstandard.requirement,
- checkstandard.remark,
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and checkstandard.id = #{id}
- </if>
- <if test="sbId != null and sbId != ''">
- and checkstandard.sb_id = #{sbId}
- </if>
- <if test="name != null and name != ''">
- and checkstandard.name = #{name}
- </if>
- <if test="level != null and level != ''">
- and checkstandard.level = #{level}
- </if>
- <if test="part != null and part != ''">
- and checkstandard.part = #{part}
- </if>
- <if test="checkUserId != null and checkUserId != ''">
- and checkstandard.check_user_id = #{checkUserId}
- </if>
- <if test="no != null and no != ''">
- and checkstandard.no = #{no}
- </if>
- <if test="type != null">
- and checkstandard.type = #{type}
- </if>
- <if test="lastDate != null">
- and checkstandard.last_date = #{lastDate}
- </if>
- <if test="nextDate != null">
- and checkstandard.next_date = #{nextDate}
- </if>
- <if test="period != null">
- and checkstandard.period = #{period}
- </if>
- <if test="periodType != null">
- and checkstandard.period_type = #{periodType}
- </if>
- <if test="checkUserType != null">
- and checkstandard.check_user_type = #{checkUserType}
- </if>
- <if test="actionType != null">
- and checkstandard.action_type = #{actionType}
- </if>
- <if test="enable != null">
- and checkstandard.enable = #{enable}
- </if>
- <if test="requirement != null and requirement != ''">
- and checkstandard.requirement = #{requirement}
- </if>
- <if test="remark != null and remark != ''">
- and checkstandard.remark = #{remark}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and checkstandard.created_user_id = #{createdUserId}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and checkstandard.update_user_id = #{updateUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and checkstandard.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and checkstandard.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and checkstandard.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and checkstandard.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and checkstandard.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and checkstandard.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and checkstandard.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and checkstandard.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and (checkstandard.name like concat('%',#{keyword},'%') or checkstandard.no like concat('%',#{keyword},'%') )
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.check.CheckStandardDTO"
- resultType="com.platform.dao.vo.query.check.CheckStandardVO">
- select checkstandard.*, sbInfo.name as sbName, sbInfo.no as sbNo,
- sbInfo.level as sbLevel,
- sbInfo.repair_user as repairUser,
- partInfo.name as partName
- from t_check_standard as checkstandard
- LEFT JOIN t_sb_info sbInfo on checkstandard.sb_id = sbInfo.id
- LEFT JOIN t_part_info partInfo on checkstandard.part = partInfo.id
- <where>
- <include refid="List_Condition"/>
- <if test="sbName != null and sbName != ''">
- and sbInfo.name like concat('%',#{sbName},'%')
- </if>
- <if test="sbNo != null and sbNo != ''">
- and sbInfo.no like concat('%',#{sbNo},'%')
- </if>
- <if test="typeId != null and typeId != ''">
- and sbInfo.type_id = #{typeId}
- </if>
- <if test="sbLevel != null and sbLevel != ''">
- and sbInfo.level = #{sbLevel}
- </if>
- </where>
- Order By
- sbInfo.level asc,
- sbInfo.no asc,
- checkstandard.period_type asc,
- checkstandard.period asc
- </select>
- <select id="selectProjectStandardList" resultType="com.platform.dao.vo.query.check.CheckStandardVO">
- select project.*, project.id as projectId
- from t_check_project_standard_relation tcppr
- inner join t_check_project project on tcppr.project_id = project.id
- inner join t_check_standard standard on tcppr.standard_id = standard.id
- where tcppr.project_id = #{projectId}
- </select>
- <select id="selectMaxNo" resultType="java.lang.String">
- select max(no) from t_check_standard
- </select>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update t_check_standard
- <set>
- <if test="item.requirement != null and item.requirement != ''">
- requirement = #{item.requirement},
- </if>
- <if test="item.remark != null and item.remark != ''">
- remark = #{item.remark},
- </if>
- <if test="item.no != null and item.no != ''">
- no = #{item.no},
- </if>
- <if test="item.name != null and item.name != ''">
- name = #{item.name},
- </if>
- <if test="item.period != null">
- period = #{item.period},
- </if>
- <if test="item.periodType != null">
- period_type = #{item.periodType},
- </if>
- <if test="item.checkUserType != null">
- check_user_type = #{item.checkUserType},
- </if>
- <if test="item.lastDate != null">
- last_date = #{item.lastDate},
- </if>
- <if test="item.nextDate != null">
- next_date = #{item.nextDate}
- </if>
- </set>
- where id = #{item.id}
- </foreach>
- </update>
- </mapper>
|