zj
2024-06-03 81a29edf665881828e4ca1f0e444bfcbc6ab6f24
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
<?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.nq.dao.ISitePayTypeMapper">
 
    <resultMap type="com.nq.pojo.SitePayType" id="payMap">
        <result property="id" column="id"/>
        <result property="payType" column="pay_type"/>
    </resultMap>
 
    <insert id="add" parameterType="string">
        insert into site_pay_type (pay_type)
        values (#{payTypeName,jdbcType=VARCHAR})
    </insert>
    <select id="getPayTypeByPayTypeName" resultType="integer" parameterType="string">
        select count(id)
        from site_pay_type
        where pay_type = #{payTypeName,jdbcType=VARCHAR}
    </select>
    <select id="getById" parameterType="integer" resultMap="payMap">
        select *
        from site_pay_type
        where id = #{id,jdbcType=INTEGER}
    </select>
    <update id="update" parameterType="com.nq.pojo.SitePayType">
        update site_pay_type
        set pay_type = #{payType,jdbcType=VARCHAR}
        where id = #{id,jdbcType=INTEGER}
    </update>
 
    <select id="listByAdmin" resultMap="payMap" parameterType="string">
        SELECT
        *
        FROM site_pay_type
        <where>
            <if test="payTypeName != null and payTypeName != '' ">
                pay_type = #{payTypeName}
            </if>
        </where>
        order by id desc
    </select>
 
    <delete id="del" parameterType="integer">
        delete from site_pay_type where id  = #{id}
    </delete>
    <select id="listAll" resultMap="payMap">
        select * from site_pay_type
    </select>
</mapper>