xing
2023-02-23 c75e6f4696634d626c5569794c6349593853223a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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.yssh.dao.YsshBjyjMapper">
    <resultMap id="YsshBjyjResult" type="com.yssh.entity.YsshBjyj">
        <id column="id" property="id" javaType="java.lang.Integer" />
        <id column="jcyj" property="jcyj" javaType="java.lang.String" jdbcType="VARCHAR" />
        <id column="jcbj" property="jcbj" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="pfyj" property="pfyj" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="pfbj" property="pfbj" javaType="java.lang.String" jdbcType="VARCHAR"/>
        </resultMap>
    <select id="query" resultType="com.yssh.entity.YsshBjyj">
        select * from yssh_bjyj where 1=1
        <if test="id != null and id != ''">
            and id = #{id}
        </if>
    </select>
    <select id="getAll" resultType="com.yssh.entity.YsshBjyj">
        select * from yssh_bjyj where 1=1
    </select>
    <select id="getJcbj" resultType="java.lang.String">
        select jcbj from yssh_bjyj where 1=1
    </select>
 
    <insert id="insert" parameterType="com.yssh.entity.YsshBjyj">
        insert into yssh_bjyj (
            jcyj, jcbj, pfyj, pfbj
        )
        values (
            #{jcyj},#{jcbj},#{pfyj},#{pfbj}
        )
    </insert>
    <delete id="delete">
        delete from yssh_bjyj where id = #{id}
    </delete>
    <update id="update">
        update yssh_bjyj
        <set >
            <if test="jcyj != null and jcyj != ''">
                jcyj = #{jcyj},
            </if>
            <if test="jcbj != null and jcbj != ''">
                jcbj = #{jcbj},
            </if>
            <if test="pfbj != null and pfbj != ''">
                pfbj = #{pfbj},
            </if>
            <if test="pfyj != null and pfyj != ''">
                pfyj = #{pfyj},
            </if>
        </set>
        where id = #{id}
    </update>
</mapper>