LinggangSchedulingMapper.xml 11.6 KB
<?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.ruoyi.mapper.scheduling.LinggangSchedulingMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.domain.scheduling.LinggangScheduling">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="schedule_date" jdbcType="DATE" property="scheduleDate"/>
        <result column="line_name" jdbcType="VARCHAR" property="lineName"/>
        <result column="job_code" jdbcType="VARCHAR" property="jobCode"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="posts" jdbcType="VARCHAR" property="posts"/>
        <result column="lp_name" jdbcType="VARCHAR" property="lpName"/>
        <result column="nbbm" jdbcType="VARCHAR" property="nbbm"/>
        <result column="bc_type" jdbcType="VARCHAR" property="bcType"/>
        <result column="fcsj_t" jdbcType="BIGINT" property="fcsjT"/>
        <result column="zdsj_t" jdbcType="BIGINT" property="zdsjT"/>
        <result column="sign_in_id" jdbcType="INTEGER" property="signInId"/>
        <result column="ex_type" jdbcType="TINYINT" property="exType"/>
        <result column="sign_time" jdbcType="TIMESTAMP" property="signTime"/>
        <result column="sign_type" jdbcType="TINYINT" property="signType"/>
        <result column="alcohol_flag" jdbcType="TINYINT" property="alcoholFlag"/>
        <result column="alcohol_intake" jdbcType="DECIMAL" property="alcoholIntake"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="key_info_id" jdbcType="INTEGER" property="keyInfoId"/>
        <result column="upDown" jdbcType="INTEGER" property="updown" />
        <result column="qdzCode" jdbcType="VARCHAR" property="qdzcode" />
        <result column="qdzName" jdbcType="VARCHAR" property="qdzname" />
        <result column="zdzCode" jdbcType="VARCHAR" property="zdzcode" />
        <result column="zdzName" jdbcType="VARCHAR" property="zdzname" />
    </resultMap>

    <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ruoyi.domain.scheduling.LinggangScheduling">
        INSERT INTO scheduling
        <include refid="insertSelectiveColumn"></include>
        <include refid="insertSelectiveValue"></include>
    </insert>
    <select id="listByCZ"  resultMap="BaseResultMap">
        select <include refid="columns"></include>   from scheduling
        <where>
            <include refid="where"></include>
            <if test="null != czCode">and (qdzcode = #{czCode} OR zdzcode = #{czCode})</if>
            <choose>
                <when test="null !=startScheduleDate and null !=endScheduleDate">and schedule_date BETWEEN
                    #{startScheduleDate} and #{endScheduleDate}
                </when>
                <when test="null !=startScheduleDate">and schedule_date &gt;= #{startScheduleDate}</when>
                <when test="null !=endScheduleDate">and schedule_date &lt;= #{endScheduleDate}</when>
            </choose>

        </where>
    </select>
    <select id="listNbbmByEntity" resultType="java.lang.String">
        select nbbm
        from scheduling
        WHERE scheduling_type = #{type} and (qdzcode = #{czCode} OR zdzcode = #{czCode}) and schedule_date BETWEEN #{startScheduleDate} and #{endScheduleDate}
        group by nbbm
    </select>

    <sql id="columns">
        id   ,  schedule_date   ,  line_name   ,  job_code   ,  name   ,  posts   ,  lp_name   ,  nbbm   ,  bc_type   ,  fcsj_t   ,  zdsj_t   ,  sign_in_id   ,  ex_type   ,  sign_time   ,  sign_type   ,  alcohol_flag   ,  alcohol_intake   ,  remark   ,  key_info_id   ,  upDown   ,  qdzCode   ,  qdzName   ,  zdzCode   ,  zdzName
    </sql>

    <sql id="insert_columns">
        id  ,  schedule_date  ,  line_name  ,  job_code  ,  name  ,  posts  ,  lp_name  ,  nbbm  ,  bc_type  ,  fcsj_t  ,  zdsj_t  ,  sign_in_id  ,  ex_type  ,  sign_time  ,  sign_type  ,  alcohol_flag  ,  alcohol_intake  ,  remark  ,  key_info_id  ,  upDown  ,  qdzCode  ,  qdzName  ,  zdzCode  ,  zdzName
    </sql>

    <sql id="insert_values">
        #{id},  #{scheduleDate},  #{lineName},  #{jobCode},  #{name},  #{posts},  #{lpName},  #{nbbm},  #{bcType},  #{fcsjT},  #{zdsjT},  #{signInId},  #{exType},  #{signTime},  #{signType},  #{alcoholFlag},  #{alcoholIntake},  #{remark},  #{keyInfoId},  #{updown},  #{qdzcode},  #{qdzname},  #{zdzcode},  #{zdzname}
    </sql>


    <sql id="insertSelectiveColumn">
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="null!=id">id,</if>
            <if test="null!=scheduleDate">schedule_date,</if>
            <if test="null!=lineName">line_name,</if>
            <if test="null!=jobCode">job_code,</if>
            <if test="null!=name">name,</if>
            <if test="null!=posts">posts,</if>
            <if test="null!=lpName">lp_name,</if>
            <if test="null!=nbbm">nbbm,</if>
            <if test="null!=bcType">bc_type,</if>
            <if test="null!=fcsjT">fcsj_t,</if>
            <if test="null!=zdsjT">zdsj_t,</if>
            <if test="null!=signInId">sign_in_id,</if>
            <if test="null!=exType">ex_type,</if>
            <if test="null!=signTime">sign_time,</if>
            <if test="null!=signType">sign_type,</if>
            <if test="null!=alcoholFlag">alcohol_flag,</if>
            <if test="null!=alcoholIntake">alcohol_intake,</if>
            <if test="null!=remark">remark,</if>
            <if test="null!=keyInfoId">key_info_id,</if>
            <if test="null!=updown">upDown,</if>
            <if test="null!=qdzcode">qdzCode,</if>
            <if test="null!=qdzname">qdzName,</if>
            <if test="null!=zdzcode">zdzCode,</if>
            <if test="null!=zdzname">zdzName,</if>
        </trim>
    </sql>

    <sql id="insertSelectiveValue">
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="null!=id">#{id,jdbcType=INTEGER},</if>
            <if test="null!=scheduleDate">#{scheduleDate,jdbcType=DATE},</if>
            <if test="null!=lineName">#{lineName,jdbcType=VARCHAR},</if>
            <if test="null!=jobCode">#{jobCode,jdbcType=VARCHAR},</if>
            <if test="null!=name">#{name,jdbcType=VARCHAR},</if>
            <if test="null!=posts">#{posts,jdbcType=VARCHAR},</if>
            <if test="null!=lpName">#{lpName,jdbcType=VARCHAR},</if>
            <if test="null!=nbbm">#{nbbm,jdbcType=VARCHAR},</if>
            <if test="null!=bcType">#{bcType,jdbcType=VARCHAR},</if>
            <if test="null!=fcsjT">#{fcsjT,jdbcType=BIGINT},</if>
            <if test="null!=zdsjT">#{zdsjT,jdbcType=BIGINT},</if>
            <if test="null!=signInId">#{signInId,jdbcType=INTEGER},</if>
            <if test="null!=exType">#{exType,jdbcType=TINYINT},</if>
            <if test="null!=signTime">#{signTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=signType">#{signType,jdbcType=TINYINT},</if>
            <if test="null!=alcoholFlag">#{alcoholFlag,jdbcType=TINYINT},</if>
            <if test="null!=alcoholIntake">#{alcoholIntake,jdbcType=DECIMAL},</if>
            <if test="null!=remark">#{remark,jdbcType=VARCHAR},</if>
            <if test="null!=keyInfoId">#{keyInfoId,jdbcType=INTEGER},</if>
            <if test="null!=updown">#{updown,jdbcType=INTEGER},</if>
            <if test="null!=qdzcode">#{qdzcode,jdbcType=VARCHAR},</if>
            <if test="null!=qdzname">#{qdzname,jdbcType=VARCHAR},</if>
            <if test="null!=zdzcode">#{zdzcode,jdbcType=VARCHAR},</if>
            <if test="null!=zdzname">#{zdzname,jdbcType=VARCHAR},</if>
        </trim>
    </sql>

    <sql id="updateByPrimaryKeySelectiveSql">
        <set>
            <if test="null!=id"> id = #{id,jdbcType=INTEGER},</if>
            <if test="null!=scheduleDate"> schedule_date = #{scheduleDate,jdbcType=DATE},</if>
            <if test="null!=lineName"> line_name = #{lineName,jdbcType=VARCHAR},</if>
            <if test="null!=jobCode"> job_code = #{jobCode,jdbcType=VARCHAR},</if>
            <if test="null!=name"> name = #{name,jdbcType=VARCHAR},</if>
            <if test="null!=posts"> posts = #{posts,jdbcType=VARCHAR},</if>
            <if test="null!=lpName"> lp_name = #{lpName,jdbcType=VARCHAR},</if>
            <if test="null!=nbbm"> nbbm = #{nbbm,jdbcType=VARCHAR},</if>
            <if test="null!=bcType"> bc_type = #{bcType,jdbcType=VARCHAR},</if>
            <if test="null!=fcsjT"> fcsj_t = #{fcsjT,jdbcType=BIGINT},</if>
            <if test="null!=zdsjT"> zdsj_t = #{zdsjT,jdbcType=BIGINT},</if>
            <if test="null!=signInId"> sign_in_id = #{signInId,jdbcType=INTEGER},</if>
            <if test="null!=exType"> ex_type = #{exType,jdbcType=TINYINT},</if>
            <if test="null!=signTime"> sign_time = #{signTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=signType"> sign_type = #{signType,jdbcType=TINYINT},</if>
            <if test="null!=alcoholFlag"> alcohol_flag = #{alcoholFlag,jdbcType=TINYINT},</if>
            <if test="null!=alcoholIntake"> alcohol_intake = #{alcoholIntake,jdbcType=DECIMAL},</if>
            <if test="null!=remark"> remark = #{remark,jdbcType=VARCHAR},</if>
            <if test="null!=keyInfoId"> key_info_id = #{keyInfoId,jdbcType=INTEGER},</if>
            <if test="null!=updown"> upDown = #{updown,jdbcType=INTEGER},</if>
            <if test="null!=qdzcode"> qdzCode = #{qdzcode,jdbcType=VARCHAR},</if>
            <if test="null!=qdzname"> qdzName = #{qdzname,jdbcType=VARCHAR},</if>
            <if test="null!=zdzcode"> zdzCode = #{zdzcode,jdbcType=VARCHAR},</if>
            <if test="null!=zdzname"> zdzName = #{zdzname,jdbcType=VARCHAR},</if>
        </set>
    </sql>

    <sql id="where">
        <if test="null!=id">AND id = #{id,jdbcType=INTEGER}, </if>
        <if test="null!=scheduleDate">AND schedule_date = #{scheduleDate,jdbcType=DATE}, </if>
        <if test="null!=lineName">AND line_name = #{lineName,jdbcType=VARCHAR}, </if>
        <if test="null!=jobCode">AND job_code = #{jobCode,jdbcType=VARCHAR}, </if>
        <if test="null!=name">AND name = #{name,jdbcType=VARCHAR}, </if>
        <if test="null!=posts">AND posts = #{posts,jdbcType=VARCHAR}, </if>
        <if test="null!=lpName">AND lp_name = #{lpName,jdbcType=VARCHAR}, </if>
        <if test="null!=nbbm">AND nbbm = #{nbbm,jdbcType=VARCHAR}, </if>
        <if test="null!=bcType">AND bc_type = #{bcType,jdbcType=VARCHAR}, </if>
        <if test="null!=fcsjT">AND fcsj_t = #{fcsjT,jdbcType=BIGINT}, </if>
        <if test="null!=zdsjT">AND zdsj_t = #{zdsjT,jdbcType=BIGINT}, </if>
        <if test="null!=signInId">AND sign_in_id = #{signInId,jdbcType=INTEGER}, </if>
        <if test="null!=exType">AND ex_type = #{exType,jdbcType=TINYINT}, </if>
        <if test="null!=signTime">AND sign_time = #{signTime,jdbcType=TIMESTAMP}, </if>
        <if test="null!=signType">AND sign_type = #{signType,jdbcType=TINYINT}, </if>
        <if test="null!=alcoholFlag">AND alcohol_flag = #{alcoholFlag,jdbcType=TINYINT}, </if>
        <if test="null!=alcoholIntake">AND alcohol_intake = #{alcoholIntake,jdbcType=DECIMAL}, </if>
        <if test="null!=remark">AND remark = #{remark,jdbcType=VARCHAR}, </if>
        <if test="null!=keyInfoId">AND key_info_id = #{keyInfoId,jdbcType=INTEGER}, </if>
        <if test="null!=updown">AND upDown = #{updown,jdbcType=INTEGER}, </if>
        <if test="null!=qdzcode">AND qdzCode = #{qdzcode,jdbcType=VARCHAR}, </if>
        <if test="null!=qdzname">AND qdzName = #{qdzname,jdbcType=VARCHAR}, </if>
        <if test="null!=zdzcode">AND zdzCode = #{zdzcode,jdbcType=VARCHAR}, </if>
        <if test="null!=zdzname">AND zdzName = #{zdzname,jdbcType=VARCHAR}, </if>
        <if test="null!=type">AND scheduling_type = #{type}  </if>
    </sql>
</mapper>