| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?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="cn.com.goldenwater.dcproj.dao.AttJobBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttJobBase" id="attJobBaseResultMap">
- <result property="guid" column="GUID"/>
- <result property="jobGuid" column="JOB_GUID"/>
- <result property="jobCode" column="JOB_CODE"/>
- <result property="jobName" column="JOB_NAME"/>
- <result property="jobLevel" column="JOB_LEVEL"/>
- <result property="jobResp" column="JOB_RESP"/>
- <result property="orgGuid" column="ORG_GUID"/>
- <result property="status" column="STATUS"/>
- <result property="modifier" column="MODIFIER"/>
- <result property="fromDate" column="FROM_DATE"/>
- <result property="toDate" column="TO_DATE"/>
- <result property="note" column="NOTE"/>
- </resultMap>
-
- <sql id="table_columns">
- GUID,
- JOB_GUID,
- JOB_CODE,
- JOB_NAME,
- JOB_LEVEL,
- JOB_RESP,
- ORG_GUID,
- STATUS,
- MODIFIER,
- FROM_DATE,
- TO_DATE,
- NOTE
- </sql>
- <sql id="entity_properties">
- #{guid},
- #{jobGuid},
- #{jobCode},
- #{jobName},
- #{jobLevel},
- #{jobResp},
- #{orgGuid},
- #{status},
- #{modifier},
- #{fromDate},
- #{toDate},
- #{note}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="jobGuid != null and jobGuid != ''">and JOB_GUID = #{jobGuid}</if>
- <if test="jobCode != null and jobCode != ''">and JOB_CODE = #{jobCode}</if>
- <if test="jobName != null and jobName != ''">and JOB_NAME = #{jobName}</if>
- <if test="jobLevel != null and jobLevel != ''">and JOB_LEVEL = #{jobLevel}</if>
- <if test="jobResp != null and jobResp != ''">and JOB_RESP = #{jobResp}</if>
- <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
- <if test="fromDate != null">and FROM_DATE = #{fromDate}</if>
- <if test="toDate != null">and TO_DATE = #{toDate}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attJobBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from att_job_base where GUID = #{id}
- </select>
- <select id="getBy" resultMap="attJobBaseResultMap">
- select <include refid="table_columns" /> from att_job_base <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attJobBaseResultMap">
- select <include refid="table_columns" /> from att_job_base
- </select>
- <select id="findList" resultMap="attJobBaseResultMap">
- select <include refid="table_columns" /> from att_job_base <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(GUID) from att_job_base <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
- insert into att_job_base( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from att_job_base where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
- delete from att_job_base <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update att_job_base set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
- update att_job_base
- <trim prefix="set" suffixOverrides=",">
- <if test="jobGuid != null and jobGuid != ''">JOB_GUID = #{jobGuid},</if>
- <if test="jobCode != null and jobCode != ''">JOB_CODE = #{jobCode},</if>
- <if test="jobName != null and jobName != ''">JOB_NAME = #{jobName},</if>
- <if test="jobLevel != null and jobLevel != ''">JOB_LEVEL = #{jobLevel},</if>
- <if test="jobResp != null and jobResp != ''">JOB_RESP = #{jobResp},</if>
- <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- <if test="toDate != null">TO_DATE = #{toDate},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <where>GUID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
- update att_job_base
- <trim prefix="set" suffixOverrides=",">
- <if test="jobGuid != null and jobGuid != ''">JOB_GUID = #{jobGuid},</if>
- <if test="jobCode != null and jobCode != ''">JOB_CODE = #{jobCode},</if>
- <if test="jobName != null and jobName != ''">JOB_NAME = #{jobName},</if>
- <if test="jobLevel != null and jobLevel != ''">JOB_LEVEL = #{jobLevel},</if>
- <if test="jobResp != null and jobResp != ''">JOB_RESP = #{jobResp},</if>
- <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
- <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
- <if test="toDate != null">TO_DATE = #{toDate},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|