SmsLogMapper.xml 7.36 KB
Newer Older
m1991's avatar
m1991 committed
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
<?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="cn.wisenergy.mapper.SmsLogMapper">

    <select id="getSmsLogById" resultType="cn.wisenergy.model.app.SmsLog">
        select
                id as id,
                codeType as codeType,
                phone as phone,
                message as message,
                failInfo as failInfo,
                status as status,
                createdUserId as createdUserId,
                updatedUserId as updatedUserId,
                creatdTime as creatdTime,
                updatedTime as updatedTime,
                isDelete as isDelete
        from sms_log
        <trim prefix="where" prefixOverrides="and | or">
            <if test="id != null">
                and id=#{id}
            </if>
        </trim>
    </select>

    <select id="getSmsLogListByMap" resultType="cn.wisenergy.model.app.SmsLog" parameterType="java.util.Map">
        select
                id as id,
                codeType as codeType,
                phone as phone,
                message as message,
                failInfo as failInfo,
                status as status,
                createdUserId as createdUserId,
                updatedUserId as updatedUserId,
                creatdTime as creatdTime,
                updatedTime as updatedTime,
                isDelete as isDelete
        from sms_log
        <trim prefix="where" prefixOverrides="and | or">
                    <if test="id != null">
                        and id=#{id}
                    </if>
                    <if test="codeType != null">
                        and codeType=#{codeType}
                    </if>
                    <if test="phone != null and phone!=''">
                        and phone=#{phone}
                    </if>
                    <if test="message != null and message!=''">
                        and message=#{message}
                    </if>
                    <if test="failInfo != null and failInfo!=''">
                        and failInfo=#{failInfo}
                    </if>
                    <if test="status != null">
                        and status=#{status}
                    </if>
                    <if test="createdUserId != null">
                        and createdUserId=#{createdUserId}
                    </if>
                    <if test="updatedUserId != null">
                        and updatedUserId=#{updatedUserId}
                    </if>
                    <if test="null!=creatdTime">
                        and creatdTime=#{creatdTime}
                    </if>
                    <if test="null!=updatedTime">
                        and updatedTime=#{updatedTime}
                    </if>
                    <if test="isDelete != null">
                        and isDelete=#{isDelete}
                    </if>
        </trim>
        <if test="beginPos != null and pageSize != null ">
            limit #{beginPos},#{pageSize}
        </if>
    </select>

    <select id="getSmsLogCountByMap" resultType="Integer"  parameterType="java.util.Map">
        select count(*) from sms_log
        <trim prefix="where" prefixOverrides="and | or">
                <if test="id != null">
                    and id=#{id}
                </if>
                <if test="codeType != null">
                    and codeType=#{codeType}
                </if>
                <if test="phone != null and phone!=''">
                    and phone=#{phone}
                </if>
                <if test="message != null and message!=''">
                    and message=#{message}
                </if>
                <if test="failInfo != null and failInfo!=''">
                    and failInfo=#{failInfo}
                </if>
                <if test="status != null">
                    and status=#{status}
                </if>
                <if test="createdUserId != null">
                    and createdUserId=#{createdUserId}
                </if>
                <if test="updatedUserId != null">
                    and updatedUserId=#{updatedUserId}
                </if>
                <if test="null!=creatdTime">
                    and creatdTime=#{creatdTime}
                </if>
                <if test="null!=updatedTime">
                    and updatedTime=#{updatedTime}
                </if>
                <if test="isDelete != null">
                    and isDelete=#{isDelete}
                </if>
        </trim>
    </select>

    <insert id="insertSmsLog" parameterType="cn.wisenergy.model.app.SmsLog">
        insert into sms_log(
                        codeType,
                        phone,
                        message,
                        failInfo,
                        status,
                        createdUserId,
                        updatedUserId,
                        creatdTime,
                        updatedTime,
                        isDelete)
        values(
                     #{codeType},
                     #{phone},
                     #{message},
                     #{failInfo},
                     #{status},
                     #{createdUserId},
                     #{updatedUserId},
                     #{creatdTime},
                     #{updatedTime},
                    #{isDelete})
    </insert>

    <update id="updateSmsLog" parameterType="cn.wisenergy.model.app.SmsLog">
        update sms_log
        <trim prefix="set" suffixOverrides="," suffix="where id=#{id}">
                            <if test="codeType != null">
                                codeType=#{codeType},
                            </if>
                            <if test="phone != null and phone!=''">
                                phone=#{phone},
                            </if>
                            <if test="message != null and message!=''">
                                message=#{message},
                            </if>
                            <if test="failInfo != null and failInfo!=''">
                                failInfo=#{failInfo},
                            </if>
                            <if test="status != null">
                                status=#{status},
                            </if>
                            <if test="createdUserId != null">
                                createdUserId=#{createdUserId},
                            </if>
                            <if test="updatedUserId != null">
                                updatedUserId=#{updatedUserId},
                            </if>
                            <if test="creatdTime != null">
                                creatdTime=#{creatdTime},
                            </if>
                            <if test="updatedTime != null">
                                updatedTime=#{updatedTime},
                            </if>
                            <if test="isDelete != null">
                                isDelete=#{isDelete}
                            </if>
        </trim>
    </update>

    <delete id="deleteSmsLogById" parameterType="String">
        delete from sms_log where id = #{id}
    </delete>

    <delete id="batchDeleteSmsLog" parameterType="java.util.Map">
        delete from sms_log where id in (
            <foreach collection="ids" item="id" separator=",">
                    #{id}
            </foreach>
        )
    </delete>
</mapper>