123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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.maintain.MaintainPlanMapper">
- <sql id="Base_Column_List">
- maintainplan.id,
- maintainplan.no,
- maintainplan.name,
- maintainplan.check_user_id,
- maintainplan.check_user_name,
- maintainplan.period,
- maintainplan.type,
- maintainplan.period_type,
- maintainplan.valid_time,
- maintainplan.valid_time_type,
- maintainplan.start_time,
- maintainplan.end_time,
- maintainplan.last_generated_time,
- maintainplan.enable,
- maintainplan.remark,
- maintainplan.created_user_id,
- maintainplan.update_user_id,
- maintainplan.created_user_name,
- maintainplan.update_user_name,
- maintainplan.created_time,
- maintainplan.update_time
- </sql>
- <sql id="Ref_Column_List">
- maintainplan.no,
- maintainplan.name,
- maintainplan.check_user_id,
- maintainplan.check_user_name,
- maintainplan.period,
- maintainplan.type,
- maintainplan.period_type,
- maintainplan.valid_time,
- maintainplan.valid_time_type,
- maintainplan.start_time,
- maintainplan.end_time,
- maintainplan.last_generated_time,
- maintainplan.enable,
- maintainplan.remark,
- </sql>
- <sql id="List_Condition">
- <if test="id != null and id != ''">
- and maintainplan.id = #{id}
- </if>
- <if test="no != null and no != ''">
- and maintainplan.no = #{no}
- </if>
- <if test="name != null and name != ''">
- and maintainplan.name = #{name}
- </if>
- <if test="checkUserId != null and checkUserId != ''">
- and maintainplan.check_user_id = #{checkUserId}
- </if>
- <if test="checkUserName != null and checkUserName != ''">
- and maintainplan.check_user_name = #{checkUserName}
- </if>
- <if test="period != null">
- and maintainplan.period = #{period}
- </if>
- <if test="type != null">
- and maintainplan.type = #{type}
- </if>
- <if test="periodType != null">
- and maintainplan.period_type = #{periodType}
- </if>
- <if test="validTime != null">
- and maintainplan.valid_time = #{validTime}
- </if>
- <if test="validTimeType != null">
- and maintainplan.valid_time_type = #{validTimeType}
- </if>
- <if test="startTimeStart != null">
- and maintainplan.start_time <![CDATA[>=]]>; #{startTimeStart}
- </if>
- <if test="startTimeEnd != null">
- and maintainplan.start_time <![CDATA[<=]]> #{startTimeEnd}
- </if>
- <if test="startTime != null">
- and maintainplan.start_time = #{startTime}
- </if>
- <if test="endTimeStart != null">
- and maintainplan.end_time <![CDATA[>=]]>; #{endTimeStart}
- </if>
- <if test="endTimeEnd != null">
- and maintainplan.end_time <![CDATA[<=]]> #{endTimeEnd}
- </if>
- <if test="currentDate != null">
- and maintainplan.start_time <![CDATA[<=]]> #{currentDate}
- and maintainplan.end_time <![CDATA[>=]]> #{currentDate}
- </if>
- <if test="endTime != null">
- and maintainplan.end_time = #{endTime}
- </if>
- <if test="lastGeneratedTimeStart != null">
- and maintainplan.last_generated_time <![CDATA[>=]]>; #{lastGeneratedTimeStart}
- </if>
- <if test="lastGeneratedTimeEnd != null">
- and maintainplan.last_generated_time <![CDATA[<=]]> #{lastGeneratedTimeEnd}
- </if>
- <if test="lastGeneratedTime != null">
- and maintainplan.last_generated_time = #{lastGeneratedTime}
- </if>
- <if test="enable != null">
- and maintainplan.enable = #{enable}
- </if>
- <if test="remark != null and remark != ''">
- and maintainplan.remark = #{remark}
- </if>
- <if test="createdUserId != null and createdUserId != ''">
- and maintainplan.created_user_id = #{createdUserId}
- </if>
- <if test="updateUserId != null and updateUserId != ''">
- and maintainplan.update_user_id = #{updateUserId}
- </if>
- <if test="createdUserName != null and createdUserName != ''">
- and maintainplan.created_user_name = #{createdUserName}
- </if>
- <if test="updateUserName != null and updateUserName != ''">
- and maintainplan.update_user_name = #{updateUserName}
- </if>
- <if test="createdTimeStart != null">
- and maintainplan.created_time <![CDATA[>=]]>; #{createdTimeStart}
- </if>
- <if test="createdTimeEnd != null">
- and maintainplan.created_time <![CDATA[<=]]> #{createdTimeEnd}
- </if>
- <if test="createdTime != null">
- and maintainplan.created_time = #{createdTime}
- </if>
- <if test="updateTimeStart != null">
- and maintainplan.update_time <![CDATA[>=]]>; #{updateTimeStart}
- </if>
- <if test="updateTimeEnd != null">
- and maintainplan.update_time <![CDATA[<=]]> #{updateTimeEnd}
- </if>
- <if test="updateTime != null">
- and maintainplan.update_time = #{updateTime}
- </if>
- <if test="keyword != null and keyword != ''">
- and maintainplan.id like concat('%',#{keyword},'%')
- </if>
- </sql>
- <select id="selectList" parameterType="com.platform.dao.dto.maintain.MaintainPlanDTO" resultType="com.platform.dao.vo.query.maintain.MaintainPlanVO">
- select maintainplan.*
- from t_maintain_plan as maintainplan
- <where>
- <include refid="List_Condition"/>
- </where>
- </select>
- <select id="selectPlanProjectList" resultType="com.platform.dao.vo.query.maintain.MaintainProjectVO">
- select project.*, sbinfo.name sbName,sbinfo.no sbNo,partinfo.no partName,partinfo.no partNo,standard.name standardName,standard.no standardNo,
- sbType.name sbType
- from t_maintain_project_plan_relation tcppr
- inner join t_maintain_plan plan on tcppr.plan_id = plan.id
- inner join t_maintain_project project on tcppr.project_id = project.id
- left join t_sb_info sbinfo on project.sb_id = sbinfo.id
- left join t_part_info partinfo on project.part_id = partinfo.id
- left join t_maintain_project_standard_relation cpsrelation on cpsrelation.project_id = project.id
- left join t_maintain_standard standard on standard.id = cpsrelation.standard_id
- left join t_sb_type sbType on sbinfo.type_id = sbType.id
- where tcppr.plan_id = #{planId}
- </select>
- </mapper>
|