Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/PileAuthCardMapper.xml

112 lines
5.2 KiB
XML
Raw Normal View History

2023-03-16 13:19:27 +08:00
<?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.jsowell.pile.mapper.PileAuthCardMapper">
<resultMap type="com.jsowell.pile.domain.PileAuthCard" id="PileAuthCardResult">
<result property="id" column="id" />
<result property="logicCard" column="logic_card" />
<result property="physicsCard" column="physics_card" />
<result property="status" column="status" />
2023-03-16 13:19:27 +08:00
<result property="memberId" column="member_id" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileAuthCardVo">
select id, logic_card, physics_card, status, member_id, create_time, create_by, update_time, update_by, del_flag from pile_auth_card
</sql>
<sql id="Base_Column_List" >
id, logic_card, physics_card, status, member_id, create_time, create_by, update_time, update_by, del_flag
2023-03-16 13:19:27 +08:00
</sql>
<select id="selectPileAuthCardList" parameterType="com.jsowell.pile.domain.PileAuthCard" resultMap="PileAuthCardResult">
<include refid="selectPileAuthCardVo"/>
<where>
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
</where>
</select>
<select id="selectPileAuthCardById" parameterType="Long" resultMap="PileAuthCardResult">
<include refid="selectPileAuthCardVo"/>
where id = #{id}
</select>
<insert id="insertPileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard" useGeneratedKeys="true" keyProperty="id">
insert into pile_auth_card
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logicCard != null">logic_card,</if>
<if test="physicsCard != null">physics_card,</if>
<if test="status != null">status,</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">member_id,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logicCard != null">#{logicCard},</if>
<if test="physicsCard != null">#{physicsCard},</if>
<if test="status != null">#{status},</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">#{memberId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileAuthCard" parameterType="com.jsowell.pile.domain.PileAuthCard">
update pile_auth_card
<trim prefix="SET" suffixOverrides=",">
<if test="logicCard != null">logic_card = #{logicCard},</if>
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
<if test="status != null">status = #{status},</if>
2023-03-16 13:19:27 +08:00
<if test="memberId != null">member_id = #{memberId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileAuthCardById" parameterType="Long">
delete from pile_auth_card where id = #{id}
</delete>
<delete id="deletePileAuthCardByIds" parameterType="String">
delete from pile_auth_card where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPileAuthCardInfo" resultMap="PileAuthCardResult">
select
<include refid="Base_Column_List"/>
from pile_auth_card
where status = '1'
<if test="memberId != null and memberId != ''">
and member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="physicsCard != null and physicsCard != ''">
and physics_card = #{physicsCard,jdbcType=VARCHAR}
</if>
<if test="logicCard != null and logicCard != ''">
and logic_card = #{logicCard,jdbcType=VARCHAR}
</if>
limit 1
</select>
2023-03-16 13:19:27 +08:00
</mapper>