<?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.javaweb.geo.mapper.LaborUnitMapper">
|
|
<resultMap type="LaborUnit" id="LaborUnitResult">
|
<result property="ids" column="ids" />
|
<result property="fullName" column="full_name" />
|
<result property="laborCode" column="labor_code" />
|
<result property="laborRange" column="labor_range" />
|
<result property="laborStatus" column="labor_status" />
|
<result property="laborType" column="labor_type" />
|
<result property="datasource" column="datasource" />
|
</resultMap>
|
|
<sql id="selectLaborUnitVo">
|
select ids, full_name, labor_code, labor_range, labor_status, labor_type, datasource from js_labor_unit
|
</sql>
|
|
<select id="selectLaborUnitList" parameterType="LaborUnit" resultMap="LaborUnitResult">
|
<include refid="selectLaborUnitVo"/>
|
<where>
|
<if test="ids != null and ids != ''"> and ids = #{ids}</if>
|
<if test="fullName != null and fullName != ''"> and full_name like concat('%', #{fullName}, '%')</if>
|
<if test="laborCode != null and laborCode != ''"> and labor_code = #{laborCode}</if>
|
<if test="laborRange != null and laborRange != ''"> and labor_range = #{laborRange}</if>
|
<if test="laborStatus != null and laborStatus != ''"> and labor_status = #{laborStatus}</if>
|
<if test="laborType != null and laborType != ''"> and labor_type = #{laborType}</if>
|
<if test="datasource != null and datasource != ''"> and datasource = #{datasource}</if>
|
</where>
|
</select>
|
|
<select id="selectLaborUnitById" parameterType="String" resultMap="LaborUnitResult">
|
<include refid="selectLaborUnitVo"/>
|
where ids = #{ids}
|
</select>
|
|
<insert id="insertLaborUnit" parameterType="LaborUnit">
|
insert into js_labor_unit
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">ids,</if>
|
<if test="fullName != null and fullName != ''">full_name,</if>
|
<if test="laborCode != null and laborCode != ''">labor_code,</if>
|
<if test="laborRange != null and laborRange != ''">labor_range,</if>
|
<if test="laborStatus != null and laborStatus != ''">labor_status,</if>
|
<if test="laborType != null and laborType != ''">labor_type,</if>
|
<if test="datasource != null and datasource != ''">datasource,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">#{ids},</if>
|
<if test="fullName != null and fullName != ''">#{fullName},</if>
|
<if test="laborCode != null and laborCode != ''">#{laborCode},</if>
|
<if test="laborRange != null and laborRange != ''">#{laborRange},</if>
|
<if test="laborStatus != null and laborStatus != ''">#{laborStatus},</if>
|
<if test="laborType != null and laborType != ''">#{laborType},</if>
|
<if test="datasource != null and datasource != ''">#{datasource},</if>
|
</trim>
|
</insert>
|
|
<update id="updateLaborUnit" parameterType="LaborUnit">
|
update js_labor_unit
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="fullName != null and fullName != ''">full_name = #{fullName},</if>
|
<if test="laborCode != null and laborCode != ''">labor_code = #{laborCode},</if>
|
<if test="laborRange != null and laborRange != ''">labor_range = #{laborRange},</if>
|
<if test="laborStatus != null and laborStatus != ''">labor_status = #{laborStatus},</if>
|
<if test="laborType != null and laborType != ''">labor_type = #{laborType},</if>
|
<if test="datasource != null and datasource != ''">datasource = #{datasource},</if>
|
</trim>
|
where ids = #{ids}
|
</update>
|
|
<delete id="deleteLaborUnitById" parameterType="String">
|
delete from js_labor_unit where ids = #{ids}
|
</delete>
|
|
<delete id="deleteLaborUnitByIds" parameterType="String">
|
delete from js_labor_unit where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|