123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <?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.xinxin.topro.sysservice.dao.mysqlmapper.DicPartPositionMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- <id column="DPL_ID" property="dplId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DPL_Part_Code" property="dplPartCode" jdbcType="VARCHAR" />
- <result column="DPL_Position_Code" property="dplPositionCode" jdbcType="VARCHAR" />
- <result column="DPL_IsDel" property="dplIsdel" jdbcType="INTEGER" />
- <result column="DPL_UserId" property="dplUserid" jdbcType="VARCHAR" />
- <result column="DPL_UpdateTime" property="dplUpdatetime" jdbcType="TIMESTAMP" />
- </resultMap>
- <resultMap id="HashMap" type="com.xinxin.topro.sysservice.vo.DicPartPositionVO" extends="BaseResultMap">
- <collection property="list" ofType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDictionaryDetail">
- <id column="SDD_ID" property="sddId" jdbcType="INTEGER" />
- <result column="SD_ID" property="sdId" jdbcType="INTEGER" />
- <result column="SDD_Detail_Code" property="sddDetailCode" jdbcType="VARCHAR" />
- <result column="SDD_Detail_Name" property="sddDetailName" jdbcType="VARCHAR" />
- <result column="SDD_PinyinCode" property="sddPinyincode" jdbcType="VARCHAR" />
- <result column="SDD_WubiCode" property="sddWubicode" jdbcType="VARCHAR" />
- <result column="SDD_OtherCode" property="sddOthercode" jdbcType="VARCHAR" />
- <result column="SDD_Sort" property="sddSort" jdbcType="INTEGER" />
- <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
- <result column="SDD_Update_Time" property="sddUpdateTime" jdbcType="TIMESTAMP" />
- <result column="SDD_IsDel" property="sddIsdel" jdbcType="INTEGER" />
- </collection>
- </resultMap>
- <sql id="Base_Column_List" >
- DPL_ID, HI_ID, DPL_Part_Code, DPL_Position_Code, DPL_IsDel, DPL_UserId, DPL_UpdateTime
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from dic_part_position
- where DPL_ID = #{dplId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from dic_part_position
- where DPL_ID = #{dplId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- insert into dic_part_position (DPL_ID, HI_ID, DPL_Part_Code,
- DPL_Position_Code, DPL_IsDel, DPL_UserId,
- DPL_UpdateTime)
- values (#{dplId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dplPartCode,jdbcType=VARCHAR},
- #{dplPositionCode,jdbcType=VARCHAR}, #{dplIsdel,jdbcType=INTEGER}, #{dplUserid,jdbcType=VARCHAR},
- now())
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- insert into dic_part_position
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="dplId != null" >
- DPL_ID,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="dplPartCode != null" >
- DPL_Part_Code,
- </if>
- <if test="dplPositionCode != null" >
- DPL_Position_Code,
- </if>
- <if test="dplIsdel != null" >
- DPL_IsDel,
- </if>
- <if test="dplUserid != null" >
- DPL_UserId,
- </if>
- <if test="dplUpdatetime != null" >
- DPL_UpdateTime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="dplId != null" >
- #{dplId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dplPartCode != null" >
- #{dplPartCode,jdbcType=VARCHAR},
- </if>
- <if test="dplPositionCode != null" >
- #{dplPositionCode,jdbcType=VARCHAR},
- </if>
- <if test="dplIsdel != null" >
- #{dplIsdel,jdbcType=INTEGER},
- </if>
- <if test="dplUserid != null" >
- #{dplUserid,jdbcType=VARCHAR},
- </if>
- <if test="dplUpdatetime != null" >
- #{dplUpdatetime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- update dic_part_position
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dplPartCode != null" >
- DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR},
- </if>
- <if test="dplPositionCode != null" >
- DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR},
- </if>
- <if test="dplIsdel != null" >
- DPL_IsDel = #{dplIsdel,jdbcType=INTEGER},
- </if>
- <if test="dplUserid != null" >
- DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
- </if>
- DPL_UpdateTime = now(),
- </set>
- where DPL_ID = #{dplId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- update dic_part_position
- set
- DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR},
- DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR},
- DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
- DPL_UpdateTime = now()
- where DPL_ID = #{dplId,jdbcType=INTEGER}
- </update>
- <select id="selectPosition" resultMap="HashMap">
- SELECT
- sdd.SDD_Detail_Name,
- sdd.SDD_ID,
- dpp.DPL_ID,
- sdd.SDD_Detail_Code,
- dpp.DPL_Part_Code
- FROM
- dic_part_position dpp,
- sys_dictionary_detail sdd
- WHERE
- sdd.SDD_Detail_Code = dpp.DPL_Position_Code
- and sdd.SD_ID = (select SD_ID from sys_dictionary where SD_DicDM = 'position')
- AND dpp.DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR}
- and sdd.SDD_IsDel = 0
- and dpp.DPL_IsDel = 0
- and (dpp.HI_ID = #{hiId,jdbcType=INTEGER} or dpp.HI_ID = 0)
- <if test="sddDetailName != null and sddDetailName != '' ">
- and (SDD_Detail_Name like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_Detail_Code like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_PinyinCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
- or SDD_WubiCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%'))
- </if>
- </select>
- <select id="selectByCode" resultType="java.lang.Integer" >
- select
- COUNT(1)
- from dic_part_position
- where DPL_Part_Code = #{dplPartCode,jdbcType=VARCHAR}
- and DPL_Position_Code = #{dplPositionCode,jdbcType=VARCHAR}
- and DPL_IsDel = 0
- and (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
- </select>
- <update id="updateDel" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicPartPosition" >
- update dic_part_position
- set
- DPL_IsDel = #{dplIsdel,jdbcType=INTEGER},
- DPL_UserId = #{dplUserid,jdbcType=VARCHAR},
- DPL_UpdateTime = now()
- where DPL_ID = #{dplId,jdbcType=INTEGER}
- </update>
- </mapper>
|