213 lines
7.8 KiB
XML
213 lines
7.8 KiB
XML
|
|
<?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.rzyc.mapper.ent.IndustryWorkMapper">
|
||
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.ent.IndustryWork">
|
||
|
|
<result column="industry_work_id" jdbcType="VARCHAR" property="industryWorkId" />
|
||
|
|
<result column="industry_id" jdbcType="VARCHAR" property="industryId" />
|
||
|
|
<result column="work_type_id" jdbcType="VARCHAR" property="workTypeId" />
|
||
|
|
<result column="created" jdbcType="VARCHAR" property="created" />
|
||
|
|
<result column="modified" jdbcType="VARCHAR" property="modified" />
|
||
|
|
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
|
||
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||
|
|
</resultMap>
|
||
|
|
<sql id="Example_Where_Clause">
|
||
|
|
<where>
|
||
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||
|
|
<if test="criteria.valid">
|
||
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||
|
|
<foreach collection="criteria.criteria" item="criterion">
|
||
|
|
<choose>
|
||
|
|
<when test="criterion.noValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.singleValue">
|
||
|
|
and ${criterion.condition} #{criterion.value}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.betweenValue">
|
||
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.listValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||
|
|
#{listItem}
|
||
|
|
</foreach>
|
||
|
|
</when>
|
||
|
|
</choose>
|
||
|
|
</foreach>
|
||
|
|
</trim>
|
||
|
|
</if>
|
||
|
|
</foreach>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
<sql id="Update_By_Example_Where_Clause">
|
||
|
|
<where>
|
||
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||
|
|
<if test="criteria.valid">
|
||
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||
|
|
<foreach collection="criteria.criteria" item="criterion">
|
||
|
|
<choose>
|
||
|
|
<when test="criterion.noValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.singleValue">
|
||
|
|
and ${criterion.condition} #{criterion.value}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.betweenValue">
|
||
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||
|
|
</when>
|
||
|
|
<when test="criterion.listValue">
|
||
|
|
and ${criterion.condition}
|
||
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||
|
|
#{listItem}
|
||
|
|
</foreach>
|
||
|
|
</when>
|
||
|
|
</choose>
|
||
|
|
</foreach>
|
||
|
|
</trim>
|
||
|
|
</if>
|
||
|
|
</foreach>
|
||
|
|
</where>
|
||
|
|
</sql>
|
||
|
|
<sql id="Base_Column_List">
|
||
|
|
industry_work_id, industry_id, work_type_id, created, modified, modify_time, create_time
|
||
|
|
</sql>
|
||
|
|
<select id="selectByExample" parameterType="com.rzyc.model.ent.IndustryWorkExample" resultMap="BaseResultMap">
|
||
|
|
select
|
||
|
|
<if test="distinct">
|
||
|
|
distinct
|
||
|
|
</if>
|
||
|
|
<include refid="Base_Column_List" />
|
||
|
|
from industry_work
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
<if test="orderByClause != null">
|
||
|
|
order by ${orderByClause}
|
||
|
|
</if>
|
||
|
|
<if test="limit != null">
|
||
|
|
<if test="offset != null">
|
||
|
|
limit ${offset}, ${limit}
|
||
|
|
</if>
|
||
|
|
<if test="offset == null">
|
||
|
|
limit ${limit}
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<delete id="deleteByExample" parameterType="com.rzyc.model.ent.IndustryWorkExample">
|
||
|
|
delete from industry_work
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</delete>
|
||
|
|
<insert id="insert" parameterType="com.rzyc.model.ent.IndustryWork">
|
||
|
|
insert into industry_work (industry_work_id, industry_id, work_type_id,
|
||
|
|
created, modified, modify_time,
|
||
|
|
create_time)
|
||
|
|
values (#{industryWorkId,jdbcType=VARCHAR}, #{industryId,jdbcType=VARCHAR}, #{workTypeId,jdbcType=VARCHAR},
|
||
|
|
#{created,jdbcType=VARCHAR}, #{modified,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
|
||
|
|
#{createTime,jdbcType=TIMESTAMP})
|
||
|
|
</insert>
|
||
|
|
<insert id="insertSelective" parameterType="com.rzyc.model.ent.IndustryWork">
|
||
|
|
insert into industry_work
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="industryWorkId != null">
|
||
|
|
industry_work_id,
|
||
|
|
</if>
|
||
|
|
<if test="industryId != null">
|
||
|
|
industry_id,
|
||
|
|
</if>
|
||
|
|
<if test="workTypeId != null">
|
||
|
|
work_type_id,
|
||
|
|
</if>
|
||
|
|
<if test="created != null">
|
||
|
|
created,
|
||
|
|
</if>
|
||
|
|
<if test="modified != null">
|
||
|
|
modified,
|
||
|
|
</if>
|
||
|
|
<if test="modifyTime != null">
|
||
|
|
modify_time,
|
||
|
|
</if>
|
||
|
|
<if test="createTime != null">
|
||
|
|
create_time,
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="industryWorkId != null">
|
||
|
|
#{industryWorkId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="industryId != null">
|
||
|
|
#{industryId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="workTypeId != null">
|
||
|
|
#{workTypeId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="created != null">
|
||
|
|
#{created,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="modified != null">
|
||
|
|
#{modified,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="modifyTime != null">
|
||
|
|
#{modifyTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="createTime != null">
|
||
|
|
#{createTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
<select id="countByExample" parameterType="com.rzyc.model.ent.IndustryWorkExample" resultType="java.lang.Long">
|
||
|
|
select count(*) from industry_work
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<update id="updateByExampleSelective" parameterType="map">
|
||
|
|
update industry_work
|
||
|
|
<set>
|
||
|
|
<if test="record.industryWorkId != null">
|
||
|
|
industry_work_id = #{record.industryWorkId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.industryId != null">
|
||
|
|
industry_id = #{record.industryId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.workTypeId != null">
|
||
|
|
work_type_id = #{record.workTypeId,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.created != null">
|
||
|
|
created = #{record.created,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.modified != null">
|
||
|
|
modified = #{record.modified,jdbcType=VARCHAR},
|
||
|
|
</if>
|
||
|
|
<if test="record.modifyTime != null">
|
||
|
|
modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
<if test="record.createTime != null">
|
||
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||
|
|
</if>
|
||
|
|
</set>
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Update_By_Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</update>
|
||
|
|
<update id="updateByExample" parameterType="map">
|
||
|
|
update industry_work
|
||
|
|
set industry_work_id = #{record.industryWorkId,jdbcType=VARCHAR},
|
||
|
|
industry_id = #{record.industryId,jdbcType=VARCHAR},
|
||
|
|
work_type_id = #{record.workTypeId,jdbcType=VARCHAR},
|
||
|
|
created = #{record.created,jdbcType=VARCHAR},
|
||
|
|
modified = #{record.modified,jdbcType=VARCHAR},
|
||
|
|
modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
|
||
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
||
|
|
<if test="_parameter != null">
|
||
|
|
<include refid="Update_By_Example_Where_Clause" />
|
||
|
|
</if>
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<!--删除行业工作单元分类-->
|
||
|
|
<delete id="delByIndustryId">
|
||
|
|
DELETE FROM `industry_work` WHERE industry_id = #{industryId}
|
||
|
|
</delete>
|
||
|
|
</mapper>
|