| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?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.ydtech.modules.fnc.dao.FncSubjectMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.model.FncSubject">
- <id column="fnc_year" jdbcType="VARCHAR" property="fncYear"/>
- <id column="sbjt_no" jdbcType="VARCHAR" property="sbjtNo"/>
- <result column="sbjt_name" jdbcType="VARCHAR" property="sbjtName"/>
- <result column="status" jdbcType="VARCHAR" property="status"/>
- <result column="createtime" jdbcType="DATE" property="createtime"/>
- <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
- <result column="shop_id" jdbcType="VARCHAR" property="shopId"/>
- </resultMap>
- <sql id="Base_Column_List">
- fnc_year, sbjt_no, sbjt_name, status, createtime, create_by, shop_id
- </sql>
- <select id="selectBySbjtNo" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from fnc_subject
- where sbjt_no = #{sbjtNo,jdbcType=VARCHAR}
- </select>
- <select id="selectBySbjtName" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from fnc_subject
- where sbjt_name = #{sbjtName,jdbcType=VARCHAR}
- </select>
- <insert id="insert" parameterType="com.ydtech.modules.fnc.model.FncSubject">
- insert into fnc_subject (fnc_year, sbjt_no, sbjt_name, status, createtime, create_by, shop_id)
- values (#{fncYear,jdbcType=VARCHAR}, #{sbjtNo,jdbcType=VARCHAR}, #{sbjtName,jdbcType=VARCHAR},
- #{status,jdbcType=VARCHAR}, #{createtime,jdbcType=DATE},
- #{createBy,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR})
- </insert>
- <select id="selectBySbjtNameIsExits" resultType="java.lang.Integer">
- select count(1)
- from fnc_subject
- where sbjt_name = #{sbjtName,jdbcType=VARCHAR}
- AND sbjt_no != #{sbjtNo,jdbcType=VARCHAR}
- </select>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.fnc.model.FncSubject">
- update fnc_subject
- <set>
- <if test="sbjtName != null">
- sbjt_name = #{sbjtName,jdbcType=VARCHAR},
- </if>
- <if test="fncYear != null">
- fnc_year = #{fncYear,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="createtime != null">
- createtime = #{createtime,jdbcType=DATE},
- </if>
- <if test="createBy != null">
- create_by = #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="shopId != null">
- shop_id = #{shopId,jdbcType=VARCHAR},
- </if>
- </set>
- where sbjt_no = #{sbjtNo,jdbcType=VARCHAR}
- </update>
- <select id="select" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from fnc_subject
- where 1=1
- <if test="sbjtNo != null and sbjtNo != '' ">
- and sbjt_No = #{sbjtNo,jdbcType=VARCHAR}
- </if>
- <if test="sbjtName != null and sbjtName != ''">
- and sbjt_name like concat('%', #{sbjtName,jdbcType=VARCHAR},'%')
- </if>
- <if test="fncYear != null and fncYear != ''">
- and fnc_year = #{fncYear,jdbcType=VARCHAR}
- </if>
- <if test="status != null and status != ''">
- and status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="createtime != null">
- and createtime = #{createtime,jdbcType=DATE}
- </if>
- <if test="createBy != null and createBy != ''">
- and create_by = #{createBy,jdbcType=VARCHAR}
- </if>
- <if test="shopId != null and shopId != ''">
- and shop_id = #{shopId,jdbcType=VARCHAR}
- </if>
- order by sbjt_no
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from fnc_subject
- where sbjt_no = #{sbjtNo,jdbcType=VARCHAR}
- </delete>
- </mapper>
|